package UnitTest.AlgorithmTest.mathTest;

import Algorithm.math.*;
import DataStructure.arrayAndList.list.Nodelj;
import DataStructure.arrayAndList.list.listRealize.ListBigIntegersOperation;

/**
 * @author liujun
 * @version 1.0
 * @date 2020/5/15
 * @author-Email ljfirst@mail.ustc.edu.cn
 * @blogURL https://blog.csdn.net/ljfirst
 * @description 大整数 测试案例
 * 1、大正数加法【字符串】
 * 2、大正数减法【字符串】
 * 3、大正数乘法【字符串】
 * 4、大正数除法【字符串】
 * 5、大正数加法【链表】
 * 6、大正数减法【链表】
 * 7、大正数乘法【链表】
 */
public class BigIntegersOperationTest extends BigIntegerOperationData {

    Nodelj nodelj = new Nodelj();
    String answer = "";
    String target = "demoNum";

    public void test(ArrayBigIntegersOperation instance, String operation) {
        for (int i = 0; i < demoNum.length; i++) {
            for (int j = 0; j < demoNum.length; j++) {
                test(instance, i + 1, j + 1, operation);
            }
        }
    }

    public void test(ArrayBigIntegersOperation instance, int num1, int num2, String operation) {
        target = "demoNum";
        switch (operation) {
            case "Sum":
                answer = instance.sumWithSymbol(demoNum[num1], demoNum[num2]);
                target += operation + num1 + "_" + num2;
            case "Sub":
                answer = instance.subWithSymbol(demoNum[num1], demoNum[num2]);
                target += operation + num1 + "_" + num2;
            case "Mul":
                answer = instance.multiWithSymbol(demoNum[num1], demoNum[num2]);
                target += operation + num1 + "_" + num2;
            case "Div":
                answer = instance.divWithSymbol(demoNum[num1], demoNum[num2]);
                target += operation + num1 + "_" + num2;
            case "Merge":
                answer = instance.mergeWithSymbol(demoNum[num1], demoNum[num2]);
                target += operation + num1 + "_" + num2;
        }
        assert answer.equals(target);
    }

    public void testArrayBigIntegersSumWithSymbol(ArrayBigIntegersOperation sum) {
        String answer = sum.sumWithSymbol(demo01, demo011);
        assert answer.equals(demo01Sum);
        answer = sum.sumWithSymbol(demo02, demo021);
        assert answer.equals(demo02Sum);
        answer = sum.sumWithSymbol(demo03, demo031);
        assert answer.equals(demo03Sum);
        answer = sum.sumWithSymbol(demo04, demo041);
        assert answer.equals(demo04Sum);
        answer = sum.sumWithSymbol(demo05, demo051);
        assert answer.equals(demo05Sum);
        answer = sum.sumWithSymbol(demo06, demo061);
        assert answer.equals(demo06Sum);
        answer = sum.sumWithSymbol(demo07, demo071);
        assert answer.equals(demo07Sum);
        answer = sum.sumWithSymbol(demo08, demo081);
        assert answer.equals(demo08Sum);
        answer = sum.sumWithSymbol(demo09, demo091);
        assert answer.equals(demo09Sum);
        answer = sum.sumWithSymbol(demo10, demo101);
        assert answer.equals(demo10Sum);
        answer = sum.sumWithSymbol(demo18, demo181);
        assert answer.equals(demo18Sum);
        answer = sum.sumWithSymbol(demo28, demo281);
        assert answer.equals(demo28Sum);
        answer = sum.sumWithSymbol(demo38, demo381);
        assert answer.equals(demo38Sum);
        answer = sum.sumWithSymbol(demo48, demo481);
        assert answer.equals(demo48Sum);
        answer = sum.sumWithSymbol(bigNumDemo18, bigNumDemo181);
        assert answer.equals(bigNumDemo18Sum);
        answer = sum.sumWithSymbol(bigNumDemo28, bigNumDemo281);
        assert answer.equals(bigNumDemo28Sum);
        answer = sum.sumWithSymbol(bigNumDemo38, bigNumDemo381);
        assert answer.equals(bigNumDemo38Sum);
        answer = sum.sumWithSymbol(bigNumDemo48, bigNumDemo481);
        assert answer.equals(bigNumDemo48Sum);
        answer = sum.sumWithSymbol(bigNumDemo58, bigNumDemo581);
        assert answer.equals(bigNumDemo58Sum);
        answer = sum.sumWithSymbol(bigNumDemo68, bigNumDemo681);
        assert answer.equals(bigNumDemo68Sum);
        answer = sum.sumWithSymbol(bigNumDemo68, bigNumDemo681);
        assert !answer.equals(bigNumDemo58Sum);
        answer = sum.sumWithSymbol(bigNumDemo78, bigNumDemo781);
        assert answer.equals(bigNumDemo78Sum);
        answer = sum.sumWithSymbol(bigNumDemo88, bigNumDemo881);
        assert answer.equals(bigNumDemo88Sum);
        answer = sum.sumWithSymbol(bigNumDemo98, bigNumDemo981);
        assert answer.equals(bigNumDemo98Sum);
    }

    public void testArrayBigIntegersSubWithSymbol(ArrayBigIntegersOperation sub) {
        String answer = sub.subWithSymbol(demo01, demo011);
        assert answer.equals(demo01Sub);
        answer = sub.subWithSymbol(demo02, demo021);
        assert answer.equals(demo02Sub);
        answer = sub.subWithSymbol(demo03, demo031);
        assert answer.equals(demo03Sub);
        answer = sub.subWithSymbol(demo04, demo041);
        assert answer.equals(demo04Sub);
        answer = sub.subWithSymbol(demo05, demo051);
        assert answer.equals(demo05Sub);
        answer = sub.subWithSymbol(demo06, demo061);
        assert answer.equals(demo06Sub);
        answer = sub.subWithSymbol(demo07, demo071);
        assert answer.equals(demo07Sub);
        answer = sub.subWithSymbol(demo08, demo081);
        assert answer.equals(demo08Sub);
        answer = sub.subWithSymbol(demo09, demo091);
        assert answer.equals(demo09Sub);
        answer = sub.subWithSymbol(demo10, demo101);
        assert answer.equals(demo10Sub);
        answer = sub.subWithSymbol(demo11, demo111);
        assert answer.equals(demo11Sub);
        answer = sub.subWithSymbol(demo12, demo121);
        assert answer.equals(demo12Sub);
        answer = sub.subWithSymbol(demo18, demo181);
        assert answer.equals(demo18Sub);
        answer = sub.subWithSymbol(demo28, demo281);
        assert answer.equals(demo28Sub);
        answer = sub.subWithSymbol(demo38, demo381);
        assert answer.equals(demo38Sub);
        answer = sub.subWithSymbol(demo48, demo481);
        assert answer.equals(demo48Sub);
        answer = sub.subWithSymbol(bigNumDemo18, bigNumDemo181);
        assert answer.equals(bigNumDemo18Sub);
        answer = sub.subWithSymbol(bigNumDemo28, bigNumDemo281);
        assert answer.equals(bigNumDemo28Sub);
        answer = sub.subWithSymbol(bigNumDemo38, bigNumDemo381);
        assert answer.equals(bigNumDemo38Sub);
        answer = sub.subWithSymbol(bigNumDemo48, bigNumDemo481);
        assert answer.equals(bigNumDemo48Sub);
        answer = sub.subWithSymbol(bigNumDemo58, bigNumDemo581);
        assert answer.equals(bigNumDemo58Sub);
        answer = sub.subWithSymbol(bigNumDemo68, bigNumDemo681);
        assert answer.equals(bigNumDemo68Sub);
        answer = sub.subWithSymbol(bigNumDemo78, bigNumDemo781);
        assert answer.equals(bigNumDemo78Sub);
        answer = sub.subWithSymbol(bigNumDemo88, bigNumDemo881);
        assert answer.equals(bigNumDemo88Sub);
        answer = sub.subWithSymbol(bigNumDemo98, bigNumDemo981);
        assert answer.equals(bigNumDemo98Sub);
    }

    public void testArrayBigIntegersMultiWithSymbol(ArrayBigIntegersOperation multi) {
        String answer = multi.multiWithSymbol(demo01, demo011);
        assert answer.equals(demo01Multi);
        answer = multi.multiWithSymbol(demo02, demo021);
        assert answer.equals(demo02Multi);
        answer = multi.multiWithSymbol(demo03, demo031);
        assert answer.equals(demo03Multi);
        answer = multi.multiWithSymbol(demo04, demo041);
        assert answer.equals(demo04Multi);
        answer = multi.multiWithSymbol(demo05, demo051);
        assert answer.equals(demo05Multi);
        answer = multi.multiWithSymbol(demo06, demo061);
        assert answer.equals(demo06Multi);
        answer = multi.multiWithSymbol(demo07, demo071);
        assert answer.equals(demo07Multi);
        answer = multi.multiWithSymbol(demo08, demo081);
        assert answer.equals(demo08Multi);
        answer = multi.multiWithSymbol(demo09, demo091);
        assert answer.equals(demo09Multi);
        answer = multi.multiWithSymbol(demo10, demo101);
        assert answer.equals(demo10Multi);
        answer = multi.multiWithSymbol(demo11, demo111);
        assert answer.equals(demo11Multi);
        answer = multi.multiWithSymbol(demo12, demo121);
        assert answer.equals(demo12Multi);
        answer = multi.multiWithSymbol(demo18, demo181);
        assert answer.equals(demo18Multi);
        answer = multi.multiWithSymbol(demo28, demo281);
        assert answer.equals(demo28Multi);
        answer = multi.multiWithSymbol(demo38, demo381);
        assert answer.equals(demo38Multi);
        answer = multi.multiWithSymbol(demo48, demo481);
        assert answer.equals(demo48Multi);

        //以9结尾的数相乘，有特殊规律
        StringBuffer demo = new StringBuffer();
        StringBuffer demoMulti = new StringBuffer();
        demo.append(9);
        for (int i = 1; i < 20; i++) {
            demo.append(9);
            answer = multi.multiWithSymbol(demo.toString(), demo.toString());

            //规律
            for (int j = 0; j < i; j++) {
                demoMulti.append(9);
            }
            demoMulti.append(8);
            for (int j = 0; j < i; j++) {
                demoMulti.append(0);
            }
            demoMulti.append(1);

            assert answer.equals(demoMulti.toString());
            demoMulti = new StringBuffer();
        }
    }

    public void testArrayBigIntegersDivWithSymbol(ArrayBigIntegersOperation div) {
        String answer = div.divWithSymbol(demo01, demo011);
        assert answer.equals(demo01Div);
        answer = div.divWithSymbol(demo02, demo021);
        assert answer.equals(demo02Div);
        answer = div.divWithSymbol(demo03, demo031);
        assert answer.equals(demo03Div);
        answer = div.divWithSymbol(demo04, demo041);
        assert answer.equals(demo04Div);
        answer = div.divWithSymbol(demo05, demo051);
        assert answer.equals(demo05Div);
        answer = div.divWithSymbol(demo06, demo061);
        assert answer.equals(demo06Div);
        answer = div.divWithSymbol(demo07, demo071);
        assert answer.equals(demo07Div);
        answer = div.divWithSymbol(demo08, demo081);
        assert answer.equals(demo08Div);
        answer = div.divWithSymbol(demo09, demo091);
        assert answer.equals(demo09Div);
        answer = div.divWithSymbol(demo18, demo181);
        assert answer.equals(demo18Div);
        answer = div.divWithSymbol(demo28, demo281);
        assert answer.equals(demo28Div);
        answer = div.divWithSymbol(demo38, demo381);
        assert answer.equals(demo38Div);
        answer = div.divWithSymbol(demo48, demo481);
        assert answer.equals(demo48Div);
    }

    public void TestArrayBigIntegersMergeWithSymbol(ArrayBigIntegersOperation merge) {
        String answer = merge.mergeWithSymbol(demo01, demo011);
        assert answer.equals(demo01Merge);
        answer = merge.mergeWithSymbol(demo02, demo021);
        assert answer.equals(demo02Merge);
        answer = merge.mergeWithSymbol(demo03, demo031);
        assert answer.equals(demo03Merge);
        answer = merge.mergeWithSymbol(demo04, demo041);
        assert answer.equals(demo04Merge);
        answer = merge.mergeWithSymbol(demo05, demo051);
        assert answer.equals(demo05Merge);
        answer = merge.mergeWithSymbol(demo06, demo061);
        assert answer.equals(demo06Merge);
        answer = merge.mergeWithSymbol(demo07, demo071);
        assert answer.equals(demo07Merge);
        answer = merge.mergeWithSymbol(demo08, demo081);
        assert answer.equals(demo08Merge);
        answer = merge.mergeWithSymbol(demo09, demo091);
        assert answer.equals(demo09Merge);
        answer = merge.mergeWithSymbol(demo10, demo101);
        assert answer.equals(demo10Merge);
    }

    public void TestListBigIntegersSumWithSymbol(ListBigIntegersOperation sum) {
        Nodelj answer = sum.sumWithSymbol(nodelj.String2Nodelj(demo01), nodelj.String2Nodelj(demo011));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo01Sum));
        answer = sum.sumWithSymbol(nodelj.String2Nodelj(demo02), nodelj.String2Nodelj(demo021));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo02Sum));
        answer = sum.sumWithSymbol(nodelj.String2Nodelj(demo03), nodelj.String2Nodelj(demo031));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo03Sum));
        answer = sum.sumWithSymbol(nodelj.String2Nodelj(demo04), nodelj.String2Nodelj(demo041));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo04Sum));
        answer = sum.sumWithSymbol(nodelj.String2Nodelj(demo05), nodelj.String2Nodelj(demo051));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo05Sum));
        answer = sum.sumWithSymbol(nodelj.String2Nodelj(demo06), nodelj.String2Nodelj(demo061));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo06Sum));
        answer = sum.sumWithSymbol(nodelj.String2Nodelj(demo07), nodelj.String2Nodelj(demo071));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo07Sum));
        answer = sum.sumWithSymbol(nodelj.String2Nodelj(demo08), nodelj.String2Nodelj(demo081));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo08Sum));
        answer = sum.sumWithSymbol(nodelj.String2Nodelj(demo09), nodelj.String2Nodelj(demo091));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo09Sum));
        answer = sum.sumWithSymbol(nodelj.String2Nodelj(demo10), nodelj.String2Nodelj(demo101));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo10Sum));
        answer = sum.sumWithSymbol(nodelj.String2Nodelj(demo11), nodelj.String2Nodelj(demo111));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo11Sum));
        answer = sum.sumWithSymbol(nodelj.String2Nodelj(demo12), nodelj.String2Nodelj(demo121));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo12Sum));
        answer = sum.sumWithSymbol(nodelj.String2Nodelj(demo18), nodelj.String2Nodelj(demo181));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo18Sum));
        answer = sum.sumWithSymbol(nodelj.String2Nodelj(demo28), nodelj.String2Nodelj(demo281));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo28Sum));
        answer = sum.sumWithSymbol(nodelj.String2Nodelj(demo38), nodelj.String2Nodelj(demo381));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo38Sum));
        answer = sum.sumWithSymbol(nodelj.String2Nodelj(demo48), nodelj.String2Nodelj(demo481));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo48Sum));
    }

    public void TestListBigIntegersSubWithSymbol(ListBigIntegersOperation sub) {
        Nodelj answer = sub.subWithSymbol(nodelj.String2Nodelj(demo01), nodelj.String2Nodelj(demo011));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo01Sum));
        answer = sub.subWithSymbol(nodelj.String2Nodelj(demo02), nodelj.String2Nodelj(demo021));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo02Sum));
        answer = sub.subWithSymbol(nodelj.String2Nodelj(demo03), nodelj.String2Nodelj(demo031));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo03Sum));
        answer = sub.subWithSymbol(nodelj.String2Nodelj(demo04), nodelj.String2Nodelj(demo041));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo04Sum));
        answer = sub.subWithSymbol(nodelj.String2Nodelj(demo05), nodelj.String2Nodelj(demo051));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo05Sum));
        answer = sub.subWithSymbol(nodelj.String2Nodelj(demo06), nodelj.String2Nodelj(demo061));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo06Sum));
        answer = sub.subWithSymbol(nodelj.String2Nodelj(demo07), nodelj.String2Nodelj(demo071));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo07Sum));
        answer = sub.subWithSymbol(nodelj.String2Nodelj(demo08), nodelj.String2Nodelj(demo081));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo08Sum));
        answer = sub.subWithSymbol(nodelj.String2Nodelj(demo09), nodelj.String2Nodelj(demo091));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo09Sum));
        answer = sub.subWithSymbol(nodelj.String2Nodelj(demo10), nodelj.String2Nodelj(demo101));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo10Sum));
        answer = sub.subWithSymbol(nodelj.String2Nodelj(demo11), nodelj.String2Nodelj(demo111));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo11Sum));
        answer = sub.subWithSymbol(nodelj.String2Nodelj(demo12), nodelj.String2Nodelj(demo121));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo12Sum));
        answer = sub.subWithSymbol(nodelj.String2Nodelj(demo18), nodelj.String2Nodelj(demo181));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo18Sum));
        answer = sub.subWithSymbol(nodelj.String2Nodelj(demo28), nodelj.String2Nodelj(demo281));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo28Sum));
        answer = sub.subWithSymbol(nodelj.String2Nodelj(demo38), nodelj.String2Nodelj(demo381));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo38Sum));
        answer = sub.subWithSymbol(nodelj.String2Nodelj(demo48), nodelj.String2Nodelj(demo481));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo48Sum));
    }

    public void TestListBigIntegersMultiWithSymbol(ListBigIntegersOperation multi) {
        Nodelj answer = multi.multiWithSymbol(nodelj.String2Nodelj(demo01), nodelj.String2Nodelj(demo011));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo01Sum));
        answer = multi.multiWithSymbol(nodelj.String2Nodelj(demo02), nodelj.String2Nodelj(demo021));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo02Sum));
        answer = multi.multiWithSymbol(nodelj.String2Nodelj(demo03), nodelj.String2Nodelj(demo031));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo03Sum));
        answer = multi.multiWithSymbol(nodelj.String2Nodelj(demo04), nodelj.String2Nodelj(demo041));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo04Sum));
        answer = multi.multiWithSymbol(nodelj.String2Nodelj(demo05), nodelj.String2Nodelj(demo051));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo05Sum));
        answer = multi.multiWithSymbol(nodelj.String2Nodelj(demo06), nodelj.String2Nodelj(demo061));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo06Sum));
        answer = multi.multiWithSymbol(nodelj.String2Nodelj(demo07), nodelj.String2Nodelj(demo071));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo07Sum));
        answer = multi.multiWithSymbol(nodelj.String2Nodelj(demo08), nodelj.String2Nodelj(demo081));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo08Sum));
        answer = multi.multiWithSymbol(nodelj.String2Nodelj(demo09), nodelj.String2Nodelj(demo091));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo09Sum));
        answer = multi.multiWithSymbol(nodelj.String2Nodelj(demo10), nodelj.String2Nodelj(demo101));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo10Sum));
        answer = multi.multiWithSymbol(nodelj.String2Nodelj(demo11), nodelj.String2Nodelj(demo111));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo11Sum));
        answer = multi.multiWithSymbol(nodelj.String2Nodelj(demo12), nodelj.String2Nodelj(demo121));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo12Sum));
        answer = multi.multiWithSymbol(nodelj.String2Nodelj(demo18), nodelj.String2Nodelj(demo181));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo18Sum));
        answer = multi.multiWithSymbol(nodelj.String2Nodelj(demo28), nodelj.String2Nodelj(demo281));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo28Sum));
        answer = multi.multiWithSymbol(nodelj.String2Nodelj(demo38), nodelj.String2Nodelj(demo381));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo38Sum));
        answer = multi.multiWithSymbol(nodelj.String2Nodelj(demo48), nodelj.String2Nodelj(demo481));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo48Sum));
    }

    public void testArrayBigIntegersMergeWithSymbol(ListBigIntegersOperation merge) {
        Nodelj answer = merge.mergeWithSymbol(nodelj.String2Nodelj(demo01), nodelj.String2Nodelj(demo011));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo01Merge));
        answer = merge.mergeWithSymbol(nodelj.String2Nodelj(demo02), nodelj.String2Nodelj(demo021));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo02Merge));
        answer = merge.mergeWithSymbol(nodelj.String2Nodelj(demo03), nodelj.String2Nodelj(demo031));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo03Merge));
        answer = merge.mergeWithSymbol(nodelj.String2Nodelj(demo04), nodelj.String2Nodelj(demo041));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo04Merge));
        answer = merge.mergeWithSymbol(nodelj.String2Nodelj(demo05), nodelj.String2Nodelj(demo051));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo05Merge));
        answer = merge.mergeWithSymbol(nodelj.String2Nodelj(demo06), nodelj.String2Nodelj(demo061));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo06Merge));
        answer = merge.mergeWithSymbol(nodelj.String2Nodelj(demo07), nodelj.String2Nodelj(demo071));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo07Merge));
        answer = merge.mergeWithSymbol(nodelj.String2Nodelj(demo08), nodelj.String2Nodelj(demo081));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo08Merge));
        answer = merge.mergeWithSymbol(nodelj.String2Nodelj(demo09), nodelj.String2Nodelj(demo091));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo09Merge));
        answer = merge.mergeWithSymbol(nodelj.String2Nodelj(demo10), nodelj.String2Nodelj(demo101));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo10Merge));
        answer = merge.mergeWithSymbol(nodelj.String2Nodelj(demo11), nodelj.String2Nodelj(demo111));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo11Merge));
        answer = merge.mergeWithSymbol(nodelj.String2Nodelj(demo12), nodelj.String2Nodelj(demo121));
        assert nodelj.equals(answer, nodelj.String2Nodelj(demo12Merge));
    }
}
